package com.example.myapplication;

public class Card {
    private int value;          // 卡片值
    private boolean isFaceUp;   // 是否正面朝上
    private boolean isMatched;  // 是否已匹配
    private int position;       // 卡片位置

    public Card(int value, int position) {
        this.value = value;
        this.position = position;
        this.isFaceUp = false;
        this.isMatched = false;
    }

    public int getValue() {
        return value;
    }

    public boolean isFaceUp() {
        return isFaceUp;
    }

    public void setFaceUp(boolean faceUp) {
        isFaceUp = faceUp;
    }

    public boolean isMatched() {
        return isMatched;
    }

    public void setMatched(boolean matched) {
        isMatched = matched;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    @Override
    public String toString() {
        return "Card{" +
                "value=" + value +
                ", isFaceUp=" + isFaceUp +
                ", isMatched=" + isMatched +
                ", position=" + position +
                '}';
    }
}